<template>
  <div class="container">
    <div class="weui_msg">
      <div class="weui_icon_area"><i class="weui_icon_success weui_icon_msg"></i></div>
      <div class="weui_text_area">
        <h2 class="weui_msg_title">挂号成功</h2>
        <p class="weui_msg_desc">
          <p style="padding:10px;" class="am-ft-sm am-ft-gray">
            <span class="am-ft-orange"><i class="fa fa-info-circle"></i></span> 特别提醒：请于{{predictEndTime}}前到医院自助报到机或农行自助终端进行报到取号，过时需到人工窗口重新挂号。
          </p>
          <span style="display: block;">候诊号：<span class="am-ft-sm am-ft-blue">{{waitNo}}</span>（有<span style="am-ft-sm am-ft-blue"> {{waitCount}}</span> 人等待）预约优先</span>
          <span style="display: block;">诊疗号：<span class="am-ft-sm am-ft-blue">{{cardNum}}</span></span>
          <span style="display: block;">姓名：<span class="am-ft-sm am-ft-blue">{{cardName}}</span></span>
          <span style="display: block;">金额：<span class="am-ft-sm am-ft-blue">{{sumFee}} 元</span></span>
          <span style="display: block;">费用类型：<span class="am-ft-sm am-ft-blue">{{patType}}</span></span>
          <span style="display: block;">就诊科室：<span class="am-ft-sm am-ft-blue">{{deptName}}</span></span>
          <span style="display: block;" v-show="doctorName">就诊医生：<span class="am-ft-sm am-ft-blue">{{doctorName}}</span></span>
          <span style="display: block;">挂号类型：<span class="am-ft-sm am-ft-blue">{{regType}}</span></span>
          <span style="display: block;" v-show="address">就诊地址：<span class="am-ft-sm am-ft-blue">{{address}}</span></span>
          <span style="display: block;">就诊班次时间：<span class="am-ft-sm am-ft-blue">{{regDate}} {{startTime}} - {{endTime}}</span></span>
          <span style="display: block;" v-show="predictTime">预计就诊时间：<span class="am-ft-sm am-ft-blue">{{predictTime}}</span></span>
          <span style="display: block;">挂号时间：<span class="am-ft-sm am-ft-blue">{{regTime}}</span></span>
          <p style="padding:10px;" class="am-ft-sm am-ft-gray">
            <span class="am-ft-orange"><i class="fa fa-info-circle"></i></span> 一卡通患者请先到分诊区进行身份确认再就诊。
          </p>
          <div style="padding-top:20px;">
            <figure style="margin: 0.2em 0.5em;">
              <img style="width: 100%;" src="../../assets/img/nonghangerweima.jpg" />
            </figure>
          </div>
          <p style="align-content: center;">长按图片关注中国农业银行顺德分行微信公众号</p>
        </p>
      </div>
      <div class="weui_opr_area">
        <p class="weui_btn_area">
          <a href="javascript:;" @click="goSearchRegInfo" class="weui_btn weui_btn_primary">查看详情</a>
        </p>
      </div>
    </div>
  </div>
</template>
<style scoped>
.weui_msg_desc label {
  width: 80px;
  display: inline-block;
}

.weui_msg_desc span {
  color: #0ae;
  font-weight: bolder;
}

span.label {
  display: inline-block;
  width: 80px;
}

span.info {
  color: #0ae;
}

.blue_tag {
  background-color: #0ae;
  color: #fff;
  font-size: 13px;
  padding: 2px 4px;
  border: none;
  vertical-align: middle;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px;
}
</style>
<script>
export default {
  name: 'RegInfoDetail',
  data: function () {
    return {
      orderId: '',
      waitNo: '',
      waitCount: '',
      cardNum: '',
      cardName: '',
      sumFee: '',
      patType: '',
      deptName: '',
      doctorName: '',
      regType: '',
      address: '',
      regDate: '',
      startTime: '',
      endTime: '',
      predictTime: '',
      predictEndTime: '',
      regTime: ''
    }
  },
  ready: function () {
    this.orderId = this.$route.query.orderId
    this.getRegOrderInfo()
  },
  methods: {
    getRegOrderInfo: function () {
      var self = this
      this.$ajax.get('GetRegOrderInfo', 'Reg', { orderId: this.orderId }).then(function (data) {
        if (data.ResultCode === '0') {
          self.waitNo = data.WaitNo
          self.waitCount = data.WaitCount
          self.cardNum = data.CardNum
          self.cardName = data.CardName
          self.sumFee = data.SumFee
          self.patType = data.PatType
          self.deptName = data.DeptName
          self.doctorName = data.DoctorName
          self.regType = data.RegType
          self.address = data.Address
          self.regDate = data.RegDate
          self.startTime = data.StartTime
          self.endTime = data.EndTime
          self.predictTime = data.PredictTime
          self.regTime = data.RegTime
          var strs = data.PredictTime.split(' ')
          self.predictEndTime = strs[0] + ' ' + strs[3]
        }
      })
    },
    goSearchRegInfo: function () {
      this.$router.replace({ name: 'searchRegInfo' })
    }
  }
}
</script>
